package com.ailight.smart.ai.feign.client;

import com.ailight.smart.ai.command.LightModelCommand;
import com.ailight.smart.ai.feign.fallbackfactory.lightApiFallbackFactory;
import com.ailight.smart.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "light-api", url = "${servers.url.light-api}", fallbackFactory = lightApiFallbackFactory.class)
public interface LightApiFeignClient {

    @PutMapping("/api/v1/control/light/operation/light")
    Result<String> operationLight(@RequestBody LightModelCommand command);

    @GetMapping("/api/v1/control/light/modify/state")
    Result<String> modifyLightState(@RequestParam("state") Integer state);
}
